var express=require('express');
var app=new express(); 
var bodyParser = require('body-parser');
const cors = require('cors')
const api=require('./routes/api.js')
const db=require('./plugins/db.js')
var multiparty = require('multiparty'); 
app.use('/upload',express.static('upload'));
db()//连接数据库
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
app.use(cors())
// console.log(api)
app.use('/',api)

app.listen(3005,'127.0.0.1',()=>{
  console.log('http://127.0.0.1:3005 is running ')
});